package com.jketing.entity.ams.base;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.springframework.format.annotation.DateTimeFormat;

import com.jketing.entity.BaseEntity;

/**
 * TechnicalTitle 技术职称实体
 * 
 * @author  李荣华
 * @version v1.0
 * @date     2018-07-08
 * @since   Jpa 2.1
 */
@Entity
@Table(name = "TechnicalTitle_")
public class TechnicalTitle extends BaseEntity {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1095435451490675104L;
	/**
	 * certificateNo:证书编号
	 */
	private String certificateNo;
	/**
	 * name:名称
	 */
	private String name;
	/**
	 * grade:级别
	 */
	private Dictionary grade;
	/**
	 * reviewTime:评审时间
	 */
	private Date reviewTime;
	/**
	 * timeOfIssue:发证时间
	 */
	private Date timeOfIssue;	
	/**
	 * IssuedBy:签发单位
	 */
	private String IssuedBy;	

	public String getCertificateNo() {
		return certificateNo;
	}
	public void setCertificateNo(String certificateNo) {
		this.certificateNo = certificateNo;
	}
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}

	@ManyToOne
	@JoinColumn(name = "gradeId")
	public Dictionary getGrade() {
		return grade;
	}
	public void setGrade(Dictionary grade) {
		this.grade = grade;
	}
	
	@DateTimeFormat(pattern="yyyy-MM-dd")
	@Temporal(value = TemporalType.DATE)
	public Date getReviewTime() {
		return reviewTime;
	}
	public void setReviewTime(Date reviewTime) {
		this.reviewTime = reviewTime;
	}

	@DateTimeFormat(pattern="yyyy-MM-dd")
	@Temporal(value = TemporalType.DATE)
	public Date getTimeOfIssue() {
		return timeOfIssue;
	}
	public void setTimeOfIssue(Date timeOfIssue) {
		this.timeOfIssue = timeOfIssue;
	}

	public String getIssuedBy() {
		return IssuedBy;
	}
	public void setIssuedBy(String issuedBy) {
		IssuedBy = issuedBy;
	}

	/**
	 * 	equals 判断实例是否相等
	 * 
	 * 	是本类实例并且实例id值相等返回true
	 * 	其它情况返回false
	 * 
	 * 	@param object 其它实例
	 */
	@Override
	public boolean equals(Object object) {
		if (!(object instanceof TechnicalTitle)) {
			return false;
		}
		TechnicalTitle other = (TechnicalTitle) object;
		if(!id.equals(other.id)){
			return false;
		}
		return true;
	}
}
